package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DemoApplication {
	@Bean
	public NettyServer createNettyServer() {
		NettyServer nettyServer = new NettyServer();
		//启动Netty服务，使用新的线程启动
		new Thread() {
			@Override
			public void run() {
				nettyServer.start(1234);
			}
		}.start();
		return nettyServer;
	}
	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

}
